package ConveyorBelt.Util;

import java.util.Vector;

import ConveyorBelt.Base.Body;

public class Collider {
	public static void checkColliding (Body one, Vector<Body> two) {
		for(int i=0; i<two.size(); i++) {
			Body obstacle = two.get(i);
			if(!one.equals(two) && one.shape.getX() == obstacle.shape.getX() && one.shape.getY() == obstacle.shape.getY()) {
				one.onCollision(obstacle);
				obstacle.onCollision(one);
			}
		}
	}
	public static void checkColliding (Body one, Body two) {
		if(!one.equals(two) && one.shape.getX() == two.shape.getY() && one.shape.getY() == two.shape.getY()) {
			one.onCollision(two);
			two.onCollision(one);
		}
	}
}
